Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Restrict [empty] in parameter input hint to zero-length string #6003

Merged
merged 19 commits into from
May 3, 2023

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Apr 18, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Apr 18, 2023

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching **/*.vue:

  • Used composition API for all new components.
  • Added component or unit tests to cover functionality.

Files matching packages/editor-ui/**/*.vue:

  • Added E2E if adding new features.
  • Used design system tokens (colors, spacings...) where possible.

Files matching cypress/e2e/**:

  • Avoided chaining commands more than two or three times (to avoid flakiness because only last one will be retried).
  • Spoofed endpoints that are not critical for the test (to avoid flakiness).
  • Picked most efficient path to start the test (for example skipped account setup and starting at /workflow/new for a canvas test).
  • Avoided adding waits on time (use request intercepts instead).
  • Ensured each spec does not depend on any another spec to pass.

Make sure to check off this list before asking for review.

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.78 🎉

Comparison is base (9c94050) 18.63% compared to head (9bfc901) 19.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6003      +/-   ##
==========================================
+ Coverage   18.63%   19.42%   +0.78%     
==========================================
  Files        2585     2591       +6     
  Lines      116483   117121     +638     
  Branches    18181    18389     +208     
==========================================
+ Hits        21711    22750    +1039     
+ Misses      94134    93706     -428     
- Partials      638      665      +27     

see 142 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Apr 18, 2023
@ivov ivov changed the title fix(editor): Display whitespace-only strings in input hint fix(editor): Quote string values in parameter input hint Apr 18, 2023
@ivov ivov marked this pull request as ready for review April 18, 2023 14:50
@ivov ivov changed the title fix(editor): Quote string values in parameter input hint fix(editor): Restrict [empty] in parameter input hint to zero-length string Apr 20, 2023
@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov requested a review from mutdmour April 24, 2023 08:51
Pinia stores setup process WIP.
@ivov
Copy link
Contributor Author

ivov commented May 2, 2023

@mutdmour Unit tests for expression resolution here require a non-trivial setup, and I worry that the ratio of user value vs time spent on this PR is already way too low. Can we reduce this to the fix and revisit unit tests as tech debt?

@mutdmour
Copy link
Contributor

mutdmour commented May 2, 2023

@mutdmour Unit tests for expression resolution here require a non-trivial setup, and I worry that the ratio of user value vs time spent on this PR is already way too low. Can we reduce this to the fix and revisit unit tests as tech debt?

alright then let's leave it

@ivov
Copy link
Contributor Author

ivov commented May 2, 2023

@mutdmour Can you please re-review? Retested at da9e85f.

Workflow
{
  "name": "ADO-529",
  "nodes": [
    {
      "parameters": {},
      "id": "45de23e5-1261-4020-b949-4b58ca367b5a",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        340,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.empty_string }}",
              "operation": "isEmpty"
            },
            {
              "value1": "={{ $json.one_whitespace }}",
              "operation": "isEmpty"
            },
            {
              "value1": "={{ $json.four_whitespaces }}",
              "operation": "isEmpty"
            },
            {
              "value1": "={{ $json.normal }}",
              "operation": "isEmpty"
            }
          ]
        }
      },
      "id": "7be87064-3dc7-4a4b-8f10-246b597f2d30",
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        620,
        300
      ]
    }
  ],
  "pinData": {
    "When clicking \"Execute Workflow\"": [
      {
        "json": {
          "empty_string": "",
          "one_whitespace": " ",
          "four_whitespaces": "    ",
          "normal": "hello"
        }
      }
    ]
  },
  "connections": {
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1352f44e-c5ca-46b9-b275-44336d6b9c89",
  "id": "20",
  "meta": {
    "instanceId": "406f1bca875c48c0fa12bf65a32e67f001617a6df6d6fd6dd72bff9d20014812"
  },
  "tags": []
}

mutdmour
mutdmour previously approved these changes May 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

⚠️ Some Cypress E2E specs are failing, please fix them before merging

mutdmour
mutdmour previously approved these changes May 2, 2023
@@ -205,7 +205,7 @@ describe('Data mapping', () => {
'have.text',
`{{ $node['${SCHEDULE_TRIGGER_NODE_NAME}'].json.input[0].count }} {{ $node['${SCHEDULE_TRIGGER_NODE_NAME}'].json.input }}`,
);
ndv.getters.parameterExpressionPreview('value').should('include.text', '[empty]');
ndv.getters.parameterExpressionPreview('value').should('include.text', ' ');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe have.text would be better here for this test

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

✅ All Cypress E2E specs passed

@ivov ivov requested a review from mutdmour May 3, 2023 07:18
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

✅ All Cypress E2E specs passed

@ivov ivov merged commit 8862e1e into master May 3, 2023
@ivov ivov deleted the ado-529-bug-expression-rendered-result branch May 3, 2023 07:41
@janober
Copy link
Member

janober commented May 3, 2023

Got released with n8n@0.227.0

MiloradFilipovic added a commit that referenced this pull request May 3, 2023
* master:
  feat(JotForm Trigger Node): Add support for hipaa-api.jotform.com (#6171)
  🚀 Release 0.227.0 (#6167)
  fix(editor): Flag issues only on workflow activation (#6127)
  fix(editor): Faster reconnects for push (no-changelog) (#6164)
  fix: Log unhandled errors during license activation (no-changelog) (#6165)
  test: Address flaky setup e2e (no-changelog) (#6085)
  fix(core): Better errors for common status codes fix
  fix(core): Fix bug running addUserActivatedColumn migration on MariaDB (#6157)
  fix: Prevent invocations of 'GET /rest/license' from returning an error when ephemeral licenses are used (#6154)
  fix(editor): Restrict `[empty]` in parameter input hint to zero-length string (#6003)
  fix(core): Assign Unknown Error only if message or description not present in error
  fix(AWS S3 Node): Fix File upload, and add node tests (#6153)
  fix(core): Better error message in Webhook node when using the POST method
  feat(Microsoft Excel 365 Node): Overhaul
  fix(core): Remove SAML config metadataUrl if XML metadata is set directly (#6143)
  ci: Restore load options methods validation (no-changelog) (#6148)
  feat(core): Add notice to alert users a new version is available
  fix(core): Fix canceled execution status (#6142)
  ci: Expand ESLint to tests in BE packages (no-changelog) (#6147)
  fix(editor): Fix focus jumping when using chrome autofill (#6140)
MiloradFilipovic added a commit that referenced this pull request May 3, 2023
…rce-mapper-ui-P2

* feature/resource-mapping-component:
  feat(JotForm Trigger Node): Add support for hipaa-api.jotform.com (#6171)
  🚀 Release 0.227.0 (#6167)
  fix(editor): Flag issues only on workflow activation (#6127)
  fix(editor): Faster reconnects for push (no-changelog) (#6164)
  fix: Log unhandled errors during license activation (no-changelog) (#6165)
  test: Address flaky setup e2e (no-changelog) (#6085)
  fix(core): Better errors for common status codes fix
  fix(core): Fix bug running addUserActivatedColumn migration on MariaDB (#6157)
  fix: Prevent invocations of 'GET /rest/license' from returning an error when ephemeral licenses are used (#6154)
  fix(editor): Restrict `[empty]` in parameter input hint to zero-length string (#6003)
  fix(core): Assign Unknown Error only if message or description not present in error
  fix(AWS S3 Node): Fix File upload, and add node tests (#6153)
  fix(core): Better error message in Webhook node when using the POST method
  feat(Microsoft Excel 365 Node): Overhaul
  fix(core): Remove SAML config metadataUrl if XML metadata is set directly (#6143)
  ci: Restore load options methods validation (no-changelog) (#6148)
  feat(core): Add notice to alert users a new version is available
  fix(core): Fix canceled execution status (#6142)
  ci: Expand ESLint to tests in BE packages (no-changelog) (#6147)
  fix(editor): Fix focus jumping when using chrome autofill (#6140)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants